package zuoye;

public class Threadint extends Thread {
	public int num=1;

	@Override
	public void run() {
		int count=0;
		while(num<=52){
			synchronized (zuoye07.lock) {
				if(zuoye07.flag){
					System.out.println(num);
					num=num+1;
					if(++count ==2){
						zuoye07.lock.notify();
						count=0;
						zuoye07.flag=false;
					}
				}else{
					try {
						zuoye07.lock.wait();
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}
	}
}
